<template>
  <div class="barChart">
    <echarts v-if="data && data.length > 0" type='bar' legend v-model="data" :dimensions='title' yName=''
      :series="series" :yAxis='yAxis'></echarts>
    <!-- <myECharts v-model="dataS" :key='keyS' xName='供应商' yName='备件费/元' :dimensions='dimensionsS'></myECharts> -->
  </div>
</template>
<script>
import echarts from '_components/echarts/echarts.vue'

export default {
  name: 'index',
  components: {
    echarts
  },
  props: {
    data: Array,
    title: Array,
  },

  data() {
    return {
      yAxis: [
        {
          axisLabel: {
            fontSize: 14,
            interval: 0,
            fontWeight: 400,
            color: '#4BA0DD',
          },
          type: 'value',
          // name: 'Temperature',
          // min: 0,
          // max: 25,
          // interval: 5,
          // axisLabel: {
          //     formatter: '{value} °C'
          // }
          splitLine: {
            show: false
          },
        }
      ],
      // dimensions:['name','num'],
      series: [
        {
          type: 'bar',
          barWidth: 8,
          // barColor:"#C1BEBE",
          name: this.title[1].legendName ? this.title[1].legendName : "所有案件",
          itemStyle: {
            color: '#1F74E2FF',
            barBorderRadius: [5, 5, 0, 0]
          },
          // stack:'x'
        },
        {
          type: 'bar',
          barGap: "-100%",
          barWidth: 8,
          // barColor:"#C1BEBE",
          name: this.title[2].legendName ? this.title[2].legendName : "在线开庭",
          itemStyle: {
            color: '#32BCD2FF',
            barBorderRadius: [5, 5, 0, 0]
          },
          // stack:'x'
        },
        {
          // name: 'Temperature',
          type: 'line',
          name: this.title[3].legendName ? this.title[3].legendName : "占比",
          yAxisIndex: 1,
          // tooltip: {
          //     valueFormatter: function (value) {
          //     return value + ' °C';
          //     }
          // },
          // data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
          itemStyle: {
            color: '#FDCA15FF',
          },
        }
      ],
      // series:{
      //     type: 'bar',
      //     barWidth: 8,
      //     // barColor:"#C1BEBE",
      //     itemStyle:{
      //         color:'#32BCD2FF',
      //         barBorderRadius:[5,5,0,0]
      //     },

      // }
    }
  },

  created() {
  },
  mounted() {
  },
  methods: {
  }
}
</script>
<style scoped>
.barChart {

  width: 100%;
  height: 100%;
}

.head img {
  width: 100%;
  height: 100%;
}
</style>


<style>

</style>
